﻿byzantine = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		has_ep3_dlc_trigger = yes
		OR = {
			capital_county ?= title:c_byzantion
			primary_title ?= title:e_byzantium
			primary_title ?= title:h_eastern_roman_empire
			AND = {
				primary_title ?= title:h_roman_empire
				title:h_roman_empire = {
					has_variable = rome_was_restored_by_byzantium
				}
			}
		}
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

mediterranean = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		capital_county ?= {
			OR = {
				culture = { has_graphical_mediterranean_culture_group_trigger = yes }
				AND = {
					culture = { has_graphical_iberian_culture_group_trigger = yes }
					NOT = { religion = religion:islam_religion }
				}
				title_province = { steppe_building_gfx_use_mediterranean_trigger = yes }
			}
		}
		trigger_if = { # Byzantine Trigger
			limit = {
				has_ep3_dlc_trigger = yes
			}
			NOR = {
				capital_county ?= title:c_byzantion
				primary_title ?= title:e_byzantium
				primary_title ?= title:h_eastern_roman_empire
				AND = {
					primary_title ?= title:h_roman_empire
					title:h_roman_empire = {
						has_variable = rome_was_restored_by_byzantium
					}
				}
			}
		}
		trigger_if = { # China trigger
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

steppe = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		has_mpo_dlc_trigger = yes
		OR = {
			government_has_flag = government_is_nomadic
			capital_county ?= {
				culture = {
					has_graphical_steppe_culture_group_trigger = yes
				}
				title_province ?= {
					has_holding = yes
					OR = {
						has_holding_type = nomad_holding
						has_holding_type = tribal_holding
					}
				}
			}
			#For tribal northerns... this is better than a big feudal western castle, right?
			capital_county ?= {
				culture = {
					OR = {
						has_graphical_steppe_culture_group_trigger = yes
						has_graphical_western_culture_group_trigger = yes
					}
					OR = {
						has_cultural_pillar = heritage_ugro_permian
						has_cultural_pillar = heritage_volga_finnic
						has_cultural_pillar = heritage_balto_finnic
					}
				}
				title_province ?= {
					has_holding = yes
					OR = {
						has_holding_type = nomad_holding
						has_holding_type = tribal_holding
					}
				}
			}
		}
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

mena = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		trigger_if = {
			limit = {
				has_mpo_dlc_trigger = no            
			}
			exists = capital_county
			capital_county = {
				OR = {
					culture = {
						OR = {
							has_graphical_mena_culture_group_trigger = yes
							has_graphical_iranian_culture_group_trigger = yes
							has_graphical_african_culture_group_trigger = yes
							AND = {
								has_graphical_iberian_culture_group_trigger  = yes
								prev.religion = religion:islam_religion
							}
						}
					}
					AND = {
						culture = {
							has_graphical_steppe_culture_group_trigger = yes
						}
						title_province = {
							steppe_building_gfx_use_mediterranean_trigger = no
							steppe_building_gfx_use_indian_trigger = no
							steppe_building_gfx_use_western_trigger = no
							steppe_building_gfx_use_east_asian_trigger = no
							steppe_building_gfx_use_japanese_trigger = no
							steppe_building_gfx_use_southeast_asian_trigger = no
						}
					}
				}
			}
		}
		trigger_else = {
			NOT = {
				government_has_flag = government_is_nomadic
			}
			exists = capital_county
			OR = {
				capital_county = {
					culture = { has_graphical_steppe_culture_group_trigger = yes }
					title_province = {
						steppe_building_gfx_use_mediterranean_trigger = no
						steppe_building_gfx_use_indian_trigger = no
						steppe_building_gfx_use_western_trigger = no
						steppe_building_gfx_use_east_asian_trigger = no
						steppe_building_gfx_use_japanese_trigger = no
						steppe_building_gfx_use_southeast_asian_trigger = no
					}
					title_province ?= {
						has_holding = yes
						NOT = {
							has_holding_type = tribal_holding
						}
					}
				}
				capital_county.culture = {
					OR = {
						has_graphical_mena_culture_group_trigger = yes
						has_graphical_iranian_culture_group_trigger = yes
						has_graphical_african_culture_group_trigger = yes               
						AND = {
							has_graphical_iberian_culture_group_trigger  = yes
							prev.religion = religion:islam_religion
						}
					}
				}
			}
		}
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

indian = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		exists = capital_county
		capital_county = {
			OR = {
				culture = { has_building_gfx = indian_building_gfx }
				culture = { has_building_gfx = tibetan_building_gfx }
				title_province = { steppe_building_gfx_use_indian_trigger = yes }
				title_province = { steppe_building_gfx_use_southeast_asian_trigger = yes }
			}
		}
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

western = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		exists = capital_county
		capital_county = {
			OR = {
				culture = { has_graphical_western_culture_group_trigger = yes }
				culture = { has_graphical_norse_culture_group_trigger = yes }
				title_province = { steppe_building_gfx_use_western_trigger = yes }
			}
		}
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

chinese = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		OR = {
			capital_county ?= {
				OR = {
					culture = { has_graphical_chinese_culture_group_trigger = yes }
					culture = { has_graphical_japanese_culture_group_trigger = yes }
					AND = {
						title_province = { steppe_building_gfx_use_east_asian_trigger = yes }
						title_province = { steppe_building_gfx_use_japanese_trigger = no }
					}
				}
			}
			primary_title ?= title:h_china
		}
		# Is a Japanese Ceremonial Liege or indepedent ruler
		trigger_if = {
			limit = {
				tgp_realm_has_ceremonial_liege_trigger = yes
				capital_county ?= {
					OR = {
						culture = { has_graphical_japanese_culture_group_trigger = yes }
						title_province = { steppe_building_gfx_use_japanese_trigger = yes }
					}
				}
			}
			tgp_has_ceremonial_liege_title_trigger = yes
		}
	}
}

japanese = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		capital_county ?= {
			OR = {
				culture = { has_graphical_japanese_culture_group_trigger = yes }
				title_province = { steppe_building_gfx_use_japanese_trigger = yes }
			}
		}
		# Is not Ceremonial Liege
		tgp_realm_has_ceremonial_liege_trigger = yes
		tgp_has_ceremonial_liege_title_trigger = no
		trigger_if = {
			limit = {
				has_tgp_dlc_trigger = yes
				NOT = {
					government_has_flag = government_is_nomadic
				}
				tgp_is_ceremonial_regent_trigger = no
			}
			NOT = { primary_title ?= title:h_china }
		}
	}
}

southeast_asia = {
	trigger = {
        NOT = { carnal_court_has_sex_animation_event_trigger = yes }
		NOT = {
			government_has_flag = government_is_nomadic
		}
		capital_county ?= {
			OR = {
				title_province = { steppe_building_gfx_use_southeast_asian_trigger = yes }
				culture = { has_building_gfx = southeast_asian_building_gfx }
			}
		}
	}
}

chinese_alt = { 
	trigger = {
		always = no # This is by design, we don't want an ahistorical throne room to spawn for players, in the future we might add a game rule though
	}
}
